from SpongeExt.pysages import plot_1d
import numpy as np

with open('mdout.txt', 'r') as file:
    line = file.readline().strip().split()
    cv_idx = line.index('CV_0')
    cv = []
    line = file.readline()
    while line:
        cv.append(float(line.strip().split()[cv_idx]))
        line = file.readline()
    
    cv = np.array(cv, np.float32)
    plot_1d(cv, -np.pi, np.pi, './cv.png')
